//
//  SLTempViewController.swift
//  langligelang
//
//  Created by 秦－政 on 2016/10/22.
//  Copyright © 2016年 pete. All rights reserved.
//

import UIKit

class SLTempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        setupUI()
        
    }
    // 监听事件
    @objc private func pushDidClick(){
        // 创建一个自身
        let vc = SLTempViewController()
        navigationController?.pushViewController(vc, animated: true)
        
    }
    private func setupUI(){
        
        // 设置背景色
        view.backgroundColor = UIColor.white
        // 创建一个barButton
        navigationItem.rightBarButtonItem = UIBarButtonItem(setHighlightedImgName: nil, title: "push", target: self, action: #selector(pushDidClick))
        navigationItem.title = "是\(navigationController?.childViewControllers.count ?? 0)个控制器"
    }
    
    
}
